package entities;

import java.io.Serializable;
import javax.persistence.*;

import java.util.Date;


/**
 * The persistent class for the film database table.
 * 
 */
@Entity
@Table(name="film")
@NamedQueries({
    @NamedQuery(name = "FilmEntity.findAll", query = "SELECT f FROM FilmEntity f"),
    @NamedQuery(name = "FilmEntity.findById", query = "SELECT f FROM FilmEntity f WHERE f.id = :id"),
    @NamedQuery(name = "FilmEntity.findByRok", query = "SELECT f FROM FilmEntity f WHERE f.rok = :rok")})
public class FilmEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	private Integer id;

	@Temporal(TemporalType.DATE)
	private Date rok;
	
	private String tytul;

	//bi-directional many-to-one association to RezyserEntity
	@ManyToOne
	@JoinColumn(name="rezyser")
	private RezyserEntity rezyserBean;

	public FilmEntity() {
	}

	public FilmEntity(String tytul2, java.sql.Date data) {
		this.tytul = tytul2;
		this.rok = data;
	}

	public FilmEntity(Integer id2, String tytul2, java.sql.Date data) {
		this.id  = id2;
		this.tytul = tytul2;
		this.rok = data;
	}

	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Date getRok() {
		return this.rok;
	}
	
	public void setRok(Date rok) {
		this.rok = rok;
	}

	public String getTytul() {
		return this.tytul;
	}

	public void setTytul(String tytul) {
		this.tytul = tytul;
	}

	public RezyserEntity getRezyserBean() {
		return this.rezyserBean;
	}

	public void setRezyserBean(RezyserEntity rezyserBean) {
		this.rezyserBean = rezyserBean;
	}
}